package com.red.servlet.order;

import com.red.service.impl.OrderServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "OrderDeleterServlet", value = "/delOrder")

public class OrderDeleteServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");

        int order_id = Integer.parseInt(request.getParameter("order_id"));

        new OrderServiceImpl().deleteOrder(order_id);

        response.setStatus(HttpServletResponse.SC_OK);
    }
}
